//
//  ZYCElectiveSelectStudentCell.m
//  ZDSC
//
//  Created by ZDTX on 2021/8/16.
//

#import "ZYCElectiveSelectStudentCell.h"
#import "ZYCCourseStudentModel.h"
#import "ZYCGrowthFileModel.h"

@interface ZYCElectiveSelectStudentCell ()


@property (nonatomic, strong) UILabel *nameLabel;
@property (nonatomic, strong) UILabel *contentLabel;


@end
@implementation ZYCElectiveSelectStudentCell
- (void)setModel:(ZYCCourseStudentModel *)model{
    _model = model;
    _nameLabel.text = model.name;
    _contentLabel.text = [NSString stringWithFormat:@"%@.%@",model.gradeNameChinese,model.className];
}

- (void)setPModel:(ZYCGrowthFileModel *)pModel{
    _pModel = pModel;
    _nameLabel.text = pModel.name;
    _contentLabel.text = [NSString stringWithFormat:@"%@.%@",pModel.gradeNameChinese,pModel.className];
}
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.bgImageView];
        [self.bgImageView addSubview:self.nameLabel];
        [self.bgImageView addSubview:self.contentLabel];
        [self.bgImageView addSubview:self.startImageView];
        [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self);
            make.top.equalTo(self).offset(27.0f);
            make.size.mas_equalTo(CGSizeMake(343.0f, 162.0f));
        }];
        
        [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.equalTo(self.bgImageView);
            make.top.equalTo(self.bgImageView.mas_top).offset(53.0f);
        }];
        
        [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.equalTo(self.bgImageView);
            make.top.equalTo(self.nameLabel.mas_bottom).offset(15.0f);
        }];
        
        [self.startImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self.bgImageView).offset(-17.0f);
            make.top.equalTo(self.bgImageView).offset(17.0f);
            make.size.mas_equalTo(CGSizeMake(18, 18));
        }];
    }
    return self;
}


- (UIImageView *)bgImageView {
    if (!_bgImageView) {
        _bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"czb"]];
    }
    return _bgImageView;
}

- (UILabel *)nameLabel {
    if (!_nameLabel) {
        _nameLabel = [UILabel LabelWithFont:kSystemBoldFont(23.0f) titleColor:HEX_RGB(@"FFFFFF") textAlignment:ZZTextAlignmentCenter];
        _nameLabel.numberOfLines = 0;
    }
    return _nameLabel;
}

- (UILabel *)contentLabel {
    if (!_contentLabel) {
        _contentLabel = [UILabel LabelWithFont:kSystemBoldFont(19.0f) titleColor:HEX_RGB(@"FFFFFF") textAlignment:ZZTextAlignmentCenter];
        _contentLabel.numberOfLines = 0;
    }
    return _contentLabel;
}

- (UIImageView *)startImageView {
    if (!_startImageView) {
        _startImageView = [[UIImageView alloc] init];
    }
    return _startImageView;
}




@end
